package src;

import java.util.Arrays;

public class MinNum {

	public static void main(String[] args) {

		System.out.println(min_num("1982", 1));
	}


	public static String min_num(String input1,int input2)
	{
		int[] inp = new int[input1.length()];
		for(int i = 0 ; i < input1.length(); i++){
			char c = input1.charAt(i);
			inp[i] = Integer.parseInt(c+"");
		}
		Arrays.sort(inp);
		String smallest = "";
		for(int i = 0 ; i< input1.length() - input2; i++){
			smallest += inp[i];
		}
		return smallest;
	}


}
